tools: Fix iptables failure test in vif-common.sh
authorKeir Fraser <keir.fraser@citrix.com>
Fri, 7 Aug 2009 16:31:27 +0000 (17:31 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Fri, 7 Aug 2009 16:31:27 +0000 (17:31 +0100)
In changset 19540 a bug was introduced in the fib_iptable function in
vif-common.sh that incorrectly checks the exit status of iptables --
it always believes iptables has failed even when it hasn't.

The attached patch fixes that.  It's also bug 1490.

Signed-off-by: John Haxby <john.haxby@oracle.com>
tools/hotplug/Linux/vif-common.sh

index fe483f9dc93bfbb8cf140dc52ff5481c2b239566..44dd342acf6af4ebd5dfdab6688c95b87edea19c 100644 (file)
@@ -78,7 +78,7 @@ frob_iptable()
   iptables "$c" FORWARD -m state --state RELATED,ESTABLISHED -m physdev \
     --physdev-out "$vif" -j ACCEPT 2>/dev/null
 
-  if [ "$command" == "online" ] && [ $? ]
+  if [ "$command" == "online" -a $? -ne 0 ]
   then
     log err "iptables setup failed. This may affect guest networking."
   fi